Skip to main content

Adding Text

In an app connected to the editor, your whole part in translation is: write the English and push.

Day to day​

  1. Use the string in your code through i18next:

    t("news.subscribe_button")
  2. Add the key and its English to the app's English file:

    {
    "news": {
    "subscribe_button": "Subscribe"
    }
    }
  3. Commit and push to a branch the editor watches.

That's all. The push syncs the new English to the editor, where it waits in the translators' inbox under your commit message. Until it is translated, the Irish version of the app shows the English.

Give strings clear names: see Naming Strings.

Rules​

  • Never add Irish to the repo. There is no Irish file to edit, and anything you add is ignored. If you know the Irish for a string, tell a translator or add it in the editor yourself.
  • The English file is the only source of English. The editor reads the file, not your code, so keys that your code builds at runtime work fine, as long as every key is in the file.
  • Write commit messages for translators. Your commit message is the title of the batch translators see in their inbox, so "Add the newsletter sign-up box" is more useful to them than "wip".

Changing and removing text​

You can change English at any time. The editor handles the rest:

You...What happens
Reword some EnglishTranslators see the change and update the Irish. Branches still on the old English keep the old Irish.
Fix only case, spacing or punctuationThe Irish keeps being used; translators just confirm it.
Rename a key without changing its EnglishThe Irish follows the new key.
Delete a keyIt stops being used on that branch only. The Irish is kept and returns if the key does.

See How It Works for the full list.

Branches and merging​

Each watched branch is synced separately, so work on a preview branch never disturbs production.

  • A string added on the preview branch can be translated straight away and checked on the preview site.
  • A string deleted on the preview branch stays on production until the change is merged.
  • Merging needs no translation step. Irish is tied to the exact English it translates, so once production has the same English, it has the same Irish.

When does the Irish go live?​

For apps that build the Irish in, the Irish on a site is whatever the editor had when that branch was last deployed. A deploy happens when you push, when a translator presses Publish, or on the app's schedule if it has one. See Publishing.

Text that changes in the live preview​

When the editor shows your app in its live preview, every translated string carries invisible markers. Code that compares a translated string with a fixed value will not match while previewing. Compare keys or state instead of translated text.